package com.ms.game.lobby;

import com.ms.game.lobby.message.SGameJackPotBrocastResponse;
import com.ms.service.error.ErrorCode;

public class GameJPBrocastData {
	
	/**每X秒廣播jpmsg**/
	public static final int BROCAST_JACKPOT_MONEY  = 30000;
	
	/**快取超時時間**/
	private long timeout = 0;
	
	/**廣播資料**/
	private SGameJackPotBrocastResponse response;
	
	/**廣播資料**/
	public SGameJackPotBrocastResponse getResponse() {
		return response;
	}
	
	public long getTimeout() {
		return timeout;
	}
	public void setTimeout(long timeout) {
		this.timeout = timeout;
	}
	
	
	public SGameJackPotBrocastResponse getAllGameJackPot()
	{
		//清理一下資料
		/*if(response!=null)
		{
			response.getJackpot().clear();
			response=null;
		}
		
		//撈取資料
		List<GameJackPotDataModel> models  = GameJackPotDAO.getGameJackPotMoney();
		HashMap<String , ArrayList<GameJackPotMoney>> map = new HashMap<String , ArrayList<GameJackPotMoney>>();
		for(GameJackPotDataModel m:models)
		{
			ArrayList<GameJackPotMoney> list = null;
			if(map.containsKey(m.getGameType()))
			{
				list = map.get(m.getGameType());
			}
			else
			{
				list = new ArrayList<GameJackPotMoney>();
			}
			
			GameJackPotMoney data = new GameJackPotMoney();
			BigDecimal big = new BigDecimal(m.getJackpotMoney().toString()).setScale(1, BigDecimal.ROUND_UP);
			data.setHalltype(m.getHallType());
			data.setJackpot(big.toString());
			
			list.add(data);
			map.put(m.getGameType(), list);
		}*/
		
		
		response = new SGameJackPotBrocastResponse();
		response.setJackpot(null);
		response.setErrorCode(ErrorCode.SUCCESS);
		return response;
	}
}
